<h1>Torrents for User <%= @user.first_name %> </h1>

<table id="torrent_list">
  <tr>
    <th>Torrent name</th>
  </tr>

<% for torrent in @torrents %>
	  <tr>
			<td><%=h torrent.name %></td>
			<td> <%= button_to 'delete', {:controller => 'torrent', :action => 'destroy', :id => torrent.id, :uid => @user.id}, :method => :delete %></td>
			<td><%= link_to 'download', :controller => 'admin', :action => 'download_torrent', :id => torrent.id, :uid => @user.id %> </td>
			<td>
			<% if(@t_status[torrent.id.to_s] == 100)%>
				<%= link_to 'retrieve', :controller => 'admin', :action => 'retrieve_torrent', :id => torrent.id %>
			<% end %>
			</td>
			<td>Percent Done: <%= @t_status[torrent.id.to_s] %></td>
		</tr>
<% end %>
</table>

<br />
<%= link_to 'Add torrent', new_torrent_path(:uid => @user.id) %>
